2020-2021 Sunseeker Telemetry and Lighting System
icc_ex1_nestedInterrupt.c File Reference
#include "driverlib.h"
#include "Board.h"

Go to the source code of this file.

Functions

void main (void)
 
 GPIO_setOutputHighOnPin (GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
 
 __delay_cycles (500000)
 
 GPIO_setOutputLowOnPin (GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
 
 GPIO_setOutputHighOnPin (GPIO_PORT_LED2, GPIO_PIN_LED2)
 
 GPIO_setOutputLowOnPin (GPIO_PORT_LED2, GPIO_PIN_LED2)
 

Function Documentation

◆ __delay_cycles()

__delay_cycles ( 500000  )

◆ GPIO_setOutputHighOnPin() [1/2]

GPIO_setOutputHighOnPin ( GPIO_PORT_LED1|  GPIO_PORT_LED2,
GPIO_PIN_LED1|  GPIO_PIN_LED2 
)

◆ GPIO_setOutputHighOnPin() [2/2]

GPIO_setOutputHighOnPin ( GPIO_PORT_LED2  ,
GPIO_PIN_LED2   
)

◆ GPIO_setOutputLowOnPin() [1/2]

GPIO_setOutputLowOnPin ( GPIO_PORT_LED1|  GPIO_PORT_LED2,
GPIO_PIN_LED1|  GPIO_PIN_LED2 
)

◆ GPIO_setOutputLowOnPin() [2/2]

GPIO_setOutputLowOnPin ( GPIO_PORT_LED2  ,
GPIO_PIN_LED2   
)

◆ main()

void main ( void  )

ICC - ICC, Nested interrupt with software configured priority

Use Interrupt Compare Controller (ICC) to show nested interrupt with software configured priority. There are 3 interrupts used in this code. Set P4 interrupt highest priority. Set P2 interrupt lowest priority. Set RTC interrupt medium priority. Use 3 LEDs to indicate the execution of 3 interrupts. When RTC interrupt is being served, P4 interrupt can preempt RTC interrupt but P2 interrupt can only be served after RTC interrupt execution is finished. Press Switch1(S1) and Switch2(S2) and then watch the LEDs status.

RTC Clock = MCLK = REFO = 32kHz, MCLK = SMCLK = default DCODIV = ~1MHz.

      MSP430FR2xx_4xx Board
         ---------------
     /|\|               |
      | |           LED1|-->RTC interrupt (Medium priority)
      --|RST   LED1&LED2|-->Port4 interrupt (Highest priority)
        |           LED2|-->Port2 interrupt (Lowest priority)
        |               |
        |               |<--S1
        |               |<--S2

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • ICC peripheral
  • GPIO Port peripheral
  • RTC peripheral

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • PORT4_VECTOR
  • PORT2_VECTOR
  • RTC_VECTOR

    Wallace Tran Texas Instruments Inc. May 2018

Definition at line 78 of file icc_ex1_nestedInterrupt.c.

References GPIO_setOutputLowOnPin().